package com.qf.mao.servlet.admin;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Properties;

/**
 * @author 啾咪小魔王
 * @date 2022/4/6 20:55
 * @since JDK 1.8
 */
@SuppressWarnings("all")
@WebServlet("/AdminServlet")
public class AdminServlet extends HttpServlet {
    private static final Properties PROPERTIES = new Properties();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=utf-8");
        PROPERTIES.load(AdminServlet.class.getResourceAsStream("/system_info.properties"));
        request.setAttribute("si",PROPERTIES);
        request.getRequestDispatcher("/WEB-INF/jsp/admin.jsp").forward(request,response);
    }
}
